﻿using Volo.Abp.Data;
using Volo.Abp.Identity;

namespace AbpProjectTemplate.Identity
{

    public static class IdentityExtensions
    {
        public static string GetDesc(this IdentityRole role)
        {
            return role.GetProperty<string>(AppRoleConsts.DescExtensionName);
        }

        public static void SetDesc(this IdentityRole role, string desc)
        {
            role.SetProperty(AppRoleConsts.DescExtensionName, desc);
        }


        public static string GetAvatar(this IdentityUser user)
        {
            return user.GetProperty<string>(AppUserConsts.AvatarExtensionName);
        }

        public static void SetAvatar(this IdentityUser user, string avatar)
        {
            user.SetProperty(AppUserConsts.AvatarExtensionName, avatar);
        }
    }
}
